Depresssed Soul, the Bible, if you think about it, reflects real life. Yes, bad things happen in the Bible. Yes, God instructs or allows violence in a violent world. Jesus taught love of neighbor, loving our enemies, sharing what we have and so on. That though did not make violence go away.
What makes violence go away in our world today? Force. Laws and punishment for breaking laws. Good people are not violent. Violent people only know force. Why should it be surprising for God to do the same? To reward those doing good to their fellow man and to warn the violent they must change.